package service.impl;

import common.Exception.Results;
import dto.req.*;
import dto.resp.AuthorLoginRespDTO;
import dto.resp.GetAuthorCommentRespDTO;
import dto.resp.QueryOneArticleByIdRespDTO;
import entity.ArticleDO;
import entity.AuthorDO;

import java.util.ArrayList;

public interface AuthorServiceImpl {
    Results addUser(AuthorRegisterReqDTO user);

    Results<AuthorDO>  queryUser(String username);

    Results<AuthorLoginRespDTO> userLogin(AuthorLoginReqDTO user);


    Results addArticle(AuthorPublishArticleReqDTO articleDO);

    /**
     * 编辑标题和正文
     */
    Results updateArticleTitle(UpdateArticleTitleReqDTO request);

    Results updateArticleContext(UpdateArticleContextReqDTO request);

    /**
     * 点赞
     * @param articleId 要点赞的文章ID
     * @param authorId 执行点赞操作的用户ID
     * @return
     */
    Results clickFavorite(Integer articleId,Integer authorId);

    /**
     * 文章评论
     * @param articleId 要评论的文章ID
     * @param authorId 执行评论操作的用户ID
     * @param comment 评论内容
     * @return
     */
    Results commentArticle(AuthorCommentReqDTO request);


    Results deleteArticle(Integer articleId,Integer authorId);


    Results<QueryOneArticleByIdRespDTO> queryOneArticleById(Integer articleId);

    Results<GetAuthorCommentRespDTO> queryUserById(Integer id);

    Results<ArrayList<QueryOneArticleByIdRespDTO>> queryAllArticleByAuthorId(Integer autthorId);
}
